*This do-file produces all the tables and figures in the main text of "Precolonial Elites and Colonial Redistribution of Political Power"
*This do-file requires the following datasets: WD1_Egypt_MPs_1824_1923.dta, RD5_Map.dta, RD6_EGY_Subdistricts_coord.dta

version 17.0


***CHANGE WORKING DIRECTORY


*FIGURE 2. Cotton and Cereals Yield Per Feddan in 1877

use "RD5_Map.dta", clear

spmap cottonyieldperfed1877P_Q using RD6_EGY_Subdistricts_coord.dta, ///
id(_ID) clnumber(4) ocolor(gs14 gs10 gs7 gs0) clmethod(unique) ndfcolor(gs14) ///
ndocolor(gs14) fcolor(gs14 gs10 gs7 gs0) ///
legend(on size(*2)) title("A. Cotton") graphregion(color(white))

graph export Figure2a.eps, replace


spmap cerealyieldperfed1877P_Q using RD6_EGY_Subdistricts_coord.dta, ///
id(_ID) clnumber(4) ocolor(gs14 gs10 gs7 gs0) clmethod(unique) ndfcolor(gs14) ///
ndocolor(gs14) fcolor(gs14 gs10 gs7 gs0) ///
legend(on size(*2)) title("B. Cereals") graphregion(color(white))

graph export Figure2b.eps, replace



*FIGURE 3. The Social Class Composition of Members of Parliament, 1824–1923

use "WD1_Egypt_MPs_1824_1923.dta", clear

graph bar (sum) aristocracy ruralbourgeoisie urbanbourgeoisie classmissing, over(cycle, label (angle(45))) stack legend(order(1 "Landed Elite" 2 "Rural Middle Class" 3 "Urban Middle Class" 4 "Missing")) title("") scheme(s2mono)

graph export Figure3.eps, replace  
   


*TABLE 1. The British Occupation and Social Class Composition of Parliament

use "WD1_Egypt_MPs_1824_1923.dta", clear

drop if Missing == 1 //136
drop if classmissing == 1 //16

local controls 1.post1882#c.cerealyieldperfed1877P


foreach y in aristocracy ruralbourgeoisie urbanbourgeoisie{
	
	quietly reghdfe `y' c.cottonyieldperfed1877P#1.post1882, absorb(cycle provincecode_1882) cluster(provincecode_1882)
	eststo `y'1
	quietly sum `y' if cycle >= 2 & cycle <= 5
	local meany = r(mean)
	quietly estadd scalar Clusters = e(N_clust)
	quietly estadd scalar Obs = e(N)
	quietly estadd scalar R2 = e(r2)
	quietly estadd scalar meany = `meany'
	quietly estadd local cyclefe "Yes"
	quietly estadd local provincefe "Yes"
	estimates store `y'1
	
	quietly reghdfe `y' c.cottonyieldperfed1877P#1.post1882 `controls', absorb(cycle provincecode_1882) cluster(provincecode_1882)
	eststo `y'2
	quietly sum `y' if cycle >= 2 & cycle <= 5
	local meany = r(mean)
	quietly estadd scalar Clusters = e(N_clust)
	quietly estadd scalar Obs = e(N)
	quietly estadd scalar R2 = e(r2)
	quietly estadd scalar meany = `meany'
	quietly estadd local cyclefe "Yes"
	quietly estadd local provincefe "Yes"
	estimates store `y'2
}


esttab aristocracy1 aristocracy2 ruralbourgeoisie1 ruralbourgeoisie2 urbanbourgeoisie1 urbanbourgeoisie2 ///
using Table1.tex, replace booktabs nogaps compress ///
keep(1.post1882#c.cottonyieldperfed1877P 1.post1882#c.cerealyieldperfed1877P) ///
coeflabel(1.post1882#c.cottonyieldperfed1877P "Post-1882 \$\times\$ Cotton" ///
1.post1882#c.cerealyieldperfed1877P "Post-1882 \$\times\$ Cereals") nomtitles ///
mgroups("\specialcell{=1 if Landed Elite}" "\specialcell{=1 if Rural\\Middle Class}" "\specialcell{=1 if Urban\\Middle Class}", pattern(1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span) ///
label se b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) nonotes ///
noconstant stats(cyclefe provincefe Clusters Obs R2 meany, fmt(0 0 0 0 2 2) label("Session FEs" "Province FEs" "Clusters (Provinces)" "Obs (MP-Session)" "\$R^2\$" "Av. Dep. Var. 1866-1882")) substitute(\_ _)



*TABLE 2. Mechanism: Precolonial Political and Economic Congruence of Precolonial Elites

use "WD1_Egypt_MPs_1824_1923.dta", clear

drop if Missing == 1 //136
drop if classmissing == 1 //16

local controls 1.post1882#c.cerealyieldperfed1877P

foreach y in aristocracy ruralbourgeoisie{
	
	
	quietly reghdfe `y' c.cottonyieldperfed1877P##c.propspeaking_count_GT8##1.post1882 `controls', absorb(cycle provincecode_1882) cluster(provincecode_1882)
	eststo `y'1
	quietly sum `y' if cycle >= 2 & cycle <= 5
	local meany = r(mean)
	quietly estadd scalar Clusters = e(N_clust)
	quietly estadd scalar Obs = e(N)
	quietly estadd scalar R2 = e(r2)
	quietly estadd scalar meany = `meany'
	quietly estadd local cyclefe "Yes"
	quietly estadd local provincefe "Yes"
	estimates store `y'1

	quietly reghdfe `y' c.cottonyieldperfed1877P##c.villagechief##1.post1882 `controls', absorb(cycle provincecode_1882) cluster(provincecode_1882)
	eststo `y'2
	quietly sum `y' if cycle >= 2 & cycle <= 5
	local meany = r(mean)
	quietly estadd scalar Clusters = e(N_clust)
	quietly estadd scalar Obs = e(N)
	quietly estadd scalar R2 = e(r2)
	quietly estadd scalar meany = `meany'
	quietly estadd local cyclefe "Yes"
	quietly estadd local provincefe "Yes"
	estimates store `y'2
	
	quietly reghdfe `y' c.cottonyieldperfed1877P##ib2.largeestatepropP_Q##1.post1882 `controls', absorb(cycle provincecode_1882) cluster(provincecode_1882)
	eststo `y'3
	quietly sum `y' if cycle >= 2 & cycle <= 5
	local meany = r(mean)
	quietly estadd scalar Clusters = e(N_clust)
	quietly estadd scalar Obs = e(N)
	quietly estadd scalar R2 = e(r2)
	quietly estadd scalar meany = `meany'
	quietly estadd local cyclefe "Yes"
	quietly estadd local provincefe "Yes"
	estimates store `y'3
	
	
	quietly reghdfe `y' c.cottonyieldperfed1877P##c.slavepdistP1882##1.post1882 `controls', absorb(cycle provincecode_1882) cluster(provincecode_1882)
	eststo `y'4
	quietly sum `y' if cycle >= 2 & cycle <= 5
	local meany = r(mean)
	quietly estadd scalar Clusters = e(N_clust)
	quietly estadd scalar Obs = e(N)
	quietly estadd scalar R2 = e(r2)
	quietly estadd scalar meany = `meany'
	quietly estadd local cyclefe "Yes"
	quietly estadd local provincefe "Yes"
	estimates store `y'4
}


esttab aristocracy1 aristocracy2 aristocracy3 aristocracy4 ruralbourgeoisie1 ruralbourgeoisie2 ruralbourgeoisie3 ruralbourgeoisie4 ///
using Table2.tex, replace booktabs nogaps compress ///
keep(1.post1882#c.cottonyieldperfed1877P 1.post1882#c.cottonyieldperfed1877P#c.propspeaking_count_GT8 ///
1.post1882#c.cottonyieldperfed1877P#c.villagechief 3.largeestatepropP_Q#1.post1882#c.cottonyieldperfed1877P ///
4.largeestatepropP_Q#1.post1882#c.cottonyieldperfed1877P 1.post1882#c.cottonyieldperfed1877P#c.slavepdistP1882 /// 
1.post1882#c.propspeaking_count_GT8 1.post1882#c.villagechief 1.largeestatepropP_Q#1.post1882 3.largeestatepropP_Q#1.post1882 4.largeestatepropP_Q#1.post1882 ///
1.post1882#c.slavepdistP1882 1.post1882#c.cerealyieldperfed1877P) ///
order(1.post1882#c.cottonyieldperfed1877P#c.propspeaking_count_GT8 ///
1.post1882#c.cottonyieldperfed1877P#c.villagechief 3.largeestatepropP_Q#1.post1882#c.cottonyieldperfed1877P ///
4.largeestatepropP_Q#1.post1882#c.cottonyieldperfed1877P 1.post1882#c.cottonyieldperfed1877P#c.slavepdistP1882 /// 
1.post1882#c.cottonyieldperfed1877P ///
1.post1882#c.propspeaking_count_GT8 1.post1882#c.villagechief 1.largeestatepropP_Q#1.post1882 3.largeestatepropP_Q#1.post1882 4.largeestatepropP_Q#1.post1882 1.post1882#c.slavepdistP1882 ///
1.post1882#c.cerealyieldperfed1877P) ///
coeflabel(1.post1882#c.cottonyieldperfed1877P#c.propspeaking_count_GT8 "Post-1882 \$\times\$ Cotton \$\times\$ Democratic Speeches Per MP" ///
1.post1882#c.cottonyieldperfed1877P#c.villagechief "Post-1882 \$\times\$ Cotton \$\times\$ N. Urabi V. Headmen Arrests" ///
3.largeestatepropP_Q#1.post1882#c.cottonyieldperfed1877P "Post-1882 \$\times\$ Cotton \$\times\$ Large Estates Land Share (Q3)" ///
4.largeestatepropP_Q#1.post1882#c.cottonyieldperfed1877P "Post-1882 \$\times\$ Cotton \$\times\$ Large Estates Land Share (Q4)" ///
1.post1882#c.cottonyieldperfed1877P#c.slavepdistP1882 "Post-1882 \$\times\$ Cotton \$\times\$ Prop. Slaves" /// 
1.post1882#c.propspeaking_count_GT8 "Post-1882 \$\times\$ Prop. Democratic Speeches" ///
1.post1882#c.villagechief "Post-1882 \$\times\$ N. Urabi V. Headmen Arrests" ////
1.largeestatepropP_Q#1.post1882 "Post-1882 \$\times\$ Large Estates Land Share (Q1)" ///
3.largeestatepropP_Q#1.post1882 "Post-1882 \$\times\$ Large Estates Land Share (Q3)" ///
4.largeestatepropP_Q#1.post1882 "Post-1882 \$\times\$ Large Estates Land Share (Q4)" ///
1.post1882#c.slavepdistP1882 "Post-1882 \$\times\$ Prop. Slaves" ///
1.post1882#c.cottonyieldperfed1877P "Post-1882 \$\times\$ Cotton" ///
1.post1882#c.cerealyieldperfed1877P "Post-1882 \$\times\$ Cereals") nomtitles ///
mgroups("\specialcell{=1 if Landed Elite}" "\specialcell{=1 if Rural\\Middle Class}", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span) ///
label se b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) nonotes ///
noconstant stats(cyclefe provincefe Clusters Obs R2 meany, fmt(0 0 0 0 2 2) label("Session FEs" "Province FEs" "Clusters (Provinces)" "Obs (MP-Session)" "\$R^2\$" "Av. Dep. Var. 1866-1882")) substitute(\_ _)



*TABLE 3. Colonial Tools of Social Re-Engineering of the Parliament: MP and Dynastic Persistence
*TABLE 4. Colonial Tools of Social Re-Engineering of the Parliament: Appointment and the Upper House

use "WD1_Egypt_MPs_1824_1923.dta", clear

drop if Missing == 1 //132
drop if classmissing == 1 //16

local controls 1.post1882#c.cerealyieldperfed1877P


foreach y in newaristocracy incaristocracy newruralbourgeoisie incruralbourgeoisie newurbanbourgeoisie incurbanbourgeoisie ///
newDaristocracy incDaristocracy newDruralbourgeoisie incDruralbourgeoisie newDurbanbourgeoisie incDurbanbourgeoisie ///
elcaristocracy apparistocracy elcruralbourgeoisie appruralbourgeoisie elcurbanbourgeoisie appurbanbourgeoisie ///
UHaristocracy LHaristocracy UHruralbourgeoisie LHruralbourgeoisie UHurbanbourgeoisie LHurbanbourgeoisie{
	quietly reghdfe `y' c.cottonyieldperfed1877P#1.post1882 `controls', absorb(cycle provincecode_1882) cluster(provincecode_1882)
	eststo `y'
	quietly sum `y' if cycle >= 2 & cycle <= 5
	local meany = r(mean)
	quietly estadd scalar Clusters = e(N_clust)
	quietly estadd scalar Obs = e(N)
	quietly estadd scalar R2 = e(r2)
	quietly estadd scalar meany = `meany'
	quietly estadd local cyclefe "Yes"
	quietly estadd local provincefe "Yes"
	estimates store `y'
}


esttab newaristocracy incaristocracy newruralbourgeoisie incruralbourgeoisie newurbanbourgeoisie incurbanbourgeoisie ///
using Table3a.tex, replace booktabs nogaps compress ///
keep(1.post1882#c.cottonyieldperfed1877P 1.post1882#c.cerealyieldperfed1877P) ///
coeflabel(1.post1882#c.cottonyieldperfed1877P "Post-1882 \$\times\$ Cotton" ///
1.post1882#c.cerealyieldperfed1877P "Post-1882 \$\times\$ Cereals") ///
mgroups("\specialcell{=1 if Landed Elite}" "\specialcell{=1 if Rural\\Middle Class}" "\specialcell{=1 if Urban\\Middle Class}" "\specialcell{=1 if Elected}", pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span) ///
mtitles("\& New" "\& Incumbent" "\& New" "\& Incumbent" "\& New" "\& Incumbent") ///
label se b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) nonotes ///
noconstant stats(cyclefe provincefe Clusters Obs R2 meany, fmt(0 0 0 0 2 2) label("Session FEs" "Province FEs" "Clusters (Provinces)" "Obs (MP-Session)" "\$R^2\$" "Av. Dep. Var. 1866-1882")) substitute(\_ _)

esttab newDaristocracy incDaristocracy newDruralbourgeoisie incDruralbourgeoisie newDurbanbourgeoisie incDurbanbourgeoisie ///
using Table3b.tex, replace booktabs nogaps compress ///
keep(1.post1882#c.cottonyieldperfed1877P 1.post1882#c.cerealyieldperfed1877P) ///
coeflabel(1.post1882#c.cottonyieldperfed1877P "Post-1882 \$\times\$ Cotton" ///
1.post1882#c.cerealyieldperfed1877P "Post-1882 \$\times\$ Cereals") ///
mgroups("\specialcell{=1 if Landed Elite}" "\specialcell{=1 if Rural\\Middle Class}" "\specialcell{=1 if Urban\\Middle Class}" "\specialcell{=1 if Elected}", pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span) ///
mtitles("\specialcell{\& New\\Dynasty}" "\specialcell{\& Incumbent\\Dynasty}" "\specialcell{\& New\\Dynasty}" "\specialcell{\& Incumbent\\Dynasty}" "\specialcell{\& New\\Dynasty}" "\specialcell{\& Incumbent\\Dynasty}") ///
label se b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) nonotes ///
noconstant stats(cyclefe provincefe Clusters Obs R2 meany, fmt(0 0 0 0 2 2) label("Session FEs" "Province FEs" "Clusters (Provinces)" "Obs (MP-Session)" "\$R^2\$" "Av. Dep. Var. 1866-1882")) substitute(\_ _)


esttab elcaristocracy apparistocracy elcruralbourgeoisie appruralbourgeoisie elcurbanbourgeoisie appurbanbourgeoisie ///
using Table4a.tex, replace booktabs nogaps compress ///
keep(1.post1882#c.cottonyieldperfed1877P 1.post1882#c.cerealyieldperfed1877P) ///
coeflabel(1.post1882#c.cottonyieldperfed1877P "Post-1882 \$\times\$ Cotton" ///
1.post1882#c.cerealyieldperfed1877P "Post-1882 \$\times\$ Cereals") ///
mgroups("\specialcell{=1 if Landed Elite}" "\specialcell{=1 if Rural\\Middle Class}" "\specialcell{=1 if Urban\\Middle Class}" "\specialcell{=1 if Elected}", pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span) ///
mtitles("\& Elected" "\& Appointed" "\& Elected" "\& Appointed" "\& Elected" "\& Appointed") ///
label se b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) nonotes ///
noconstant stats(cyclefe provincefe Clusters Obs R2 meany, fmt(0 0 0 0 2 2) label("Session FEs" "Province FEs" "Clusters (Provinces)" "Obs (MP-Session)" "\$R^2\$" "Av. Dep. Var. 1866-1882")) substitute(\_ _)


esttab UHaristocracy LHaristocracy UHruralbourgeoisie LHruralbourgeoisie UHurbanbourgeoisie LHurbanbourgeoisie ///
using Table4b.tex, replace booktabs nogaps compress ///
keep(1.post1882#c.cottonyieldperfed1877P 1.post1882#c.cerealyieldperfed1877P) ///
coeflabel(1.post1882#c.cottonyieldperfed1877P "Post-1882 \$\times\$ Cotton" ///
1.post1882#c.cerealyieldperfed1877P "Post-1882 \$\times\$ Cereals") ///
mgroups("\specialcell{Landed Elite}" "\specialcell{=1 if Rural\\Middle Class}" "\specialcell{=1 if Urban\\Middle Class}" "\specialcell{=1 if Elected}", pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span) ///
mtitles("\& UH" "\& LH" "\& UH" "\& LH" "\& UH" "\&LH") ///
label se b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) nonotes ///
noconstant stats(cyclefe provincefe Clusters Obs R2 meany, fmt(0 0 0 0 2 2) label("Session FEs" "Province FEs" "Clusters (Provinces)" "Obs (MP-Session)" "\$R^2\$" "Av. Dep. Var. 1866-1882")) substitute(\_ _)





	
